<template>
  <view class="commonHeight">
    <view
      v-for="list in memberStore.deptMap"
      :key="list.id"
      class="list"
      :class="{ activeClass: deptId == list.deptId }"
      @click="handleClick(list)"
    >
      {{ list.name }}
    </view>
  </view>
</template>

<script setup>
import { useMemberStore } from "@/stores/modules/member";
defineProps(["deptId"]);
const memberStore = useMemberStore();
const emits = defineEmits("close");
const handleClick = (list) => {
  memberStore.typeAndDep.deptId = list.deptId;
  memberStore.typeAndDep.name = list.name;
  emits("close");
};
</script>

<style lang="scss" scoped>
.commonHeight {
  max-height: 88vh;
  overflow-y: auto;
}
.list {
  width: 50vw;
  padding: 40rpx;
  border-bottom: 1px solid #ccc;
}
</style>